package agrpg.views;

import ag.AGContext;
import ag.AGEngine;
import ag.AGModelManager;
import ag.AGResource;
import ag.AGView;
import ag.rpg.AGRPGObject;
import android.graphics.PointF;

public class TestView extends AGView {

	private AGRPGObject _object1;
	private AGRPGObject _object2;
	private AGRPGObject _object3;

	private AGRPGObject _object21;
	
	public void onCreate(){
		this._object1 = new AGRPGObject(AGModelManager.getInstance().getModel(8001));
		this._object1.setPosition(new PointF(50,210));
		this._object1.setDirection(AGRPGObject.DIRECTION_SOUTHEAST);
		
		this._object2 = new AGRPGObject(AGModelManager.getInstance().getModel(8001));
		this._object2.setPosition(new PointF(130,160));
		this._object2.setDirection(AGRPGObject.DIRECTION_SOUTHEAST);
		this._object2.showAttack();
		
		this._object3 = new AGRPGObject(AGModelManager.getInstance().getModel(8001));
		this._object3.setPosition(new PointF(200,120));
		this._object3.setDirection(AGRPGObject.DIRECTION_SOUTHEAST);
		this._object3.setAction(AGRPGObject.ACTION_DEATH);
		

		this._object21 = new AGRPGObject(AGModelManager.getInstance().getModel(8001));
		this._object21.setPosition(new PointF(598,360));
		this._object21.setAction(AGRPGObject.ACTION_STAND);
		this._object21.setDirection(AGRPGObject.DIRECTION_NORTHWEST);
	}
	
	@Override
	public void onUpdate(AGContext context){
		this._object1.onUpdate(context);
		this._object2.onUpdate(context);
		this._object3.onUpdate(context);
		
		this._object21.onUpdate(context);
		
		if(context.getIDI().isTouchMove()){
			this._object1.showAttack();
		}
	}
	
	@Override
	public void onRender(AGContext context){
		this._object1.onRender(context);
		this._object2.onRender(context);
		this._object3.onRender(context);
		

		this._object21.onRender(context);
	}
}
